<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>设计模式</title>
</head>

<body>
  <h2>原型模式</h2>
  <script>
    const food = {
      name: '西兰花炒蛋',
      eat() {
        console.log('好好吃')
      },
    }

    // ------------- Object.create -------------
    const nFood = Object.create(food)


  </script>
</body>

</html>